<div id="vk_auth"></div>

<script type="text/javascript">
VK.Widgets.Auth("vk_auth", {ldelim}width: "200px", authUrl: '{$index_script}?{$place_name}=auth&{$mode_name}=login&by=vk'{rdelim});
</script>



{*
<div id="vk_api_transport"></div>
<div id="vk_login" onclick="doLogin()"></div>
{<script src="http://vkontakte.ru/js/api/openapi.js" type="text/javascript" charset="utf-8"></script>}
{literal}
<script type="text/javascript">
    window.vkAsyncInit = function() {
        VK.init({
            apiId: 1882282,
            nameTransportPath: '/gifts/include/vk/xd_receiver.htm'
        });

        VK.UI.button('vk_login');
    };

    (function() {
        var el = document.createElement("script");
        el.type = "text/javascript";
        el.charset = "utf-8";  
        el.src = "http://vkontakte.ru/js/api/openapi.js";
        el.async = true;
        document.getElementById("vk_api_transport").appendChild(el);
    }());

function doLogin() {
  VK.Auth.login(afterLogin);
}

function afterLogin (response) {
 /   window.location = current_location + '/' + index_script + '?' + place_name + '=auth&' + mode_name = 'login&by=vk';/
    window.location = 'http://filimonchuk.com/gifts/index.php?place=auth&mode=login&by=vk';
}

</script>
{/literal*}